package com.cq.cqmall.product.feign;

import com.cq.common.to.SkuReductionTO;
import com.cq.common.to.SpuBoundTO;
import com.cq.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 优惠券Feignservice
 *
 * @author 程崎
 * @since 2022/09/29
 */
@FeignClient("cq-mall-coupon")
public interface CouponFeignService {

    /**
     * 保存spu界限
     * 只要json数据模型是兼容的，双方服务无需使用同一个TO
     *
     * @param spuBoundTo spu绑定到
     * @return {@link R}
     */
    @PostMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundTO spuBoundTo);

    /**
     * 保存sku减少
     *
     * @param skuReductionTo sku减少
     * @return {@link R}
     */
    @PostMapping("/coupon/skufullreduction/saveinfo")
    R saveSkuReduction(@RequestBody SkuReductionTO skuReductionTo);
}
